package qianting.news.user.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import qianting.news.apis.models.user.pojos.ApUser;

@Mapper
public interface ApUserMapper extends BaseMapper<ApUser> {

    @Update("UPDATE ap_user set name=#{username} where id=#{id}")
    boolean updateUsernameById(Long id, String username);

    @Update("UPDATE ap_user set password=#{password} where id=#{id}")
    boolean updatePasswordById(Long id, String password);

    @Select("SELECT salt from ap_user where id=#{id}")
    String getSaltById(Long id);

    @Update("UPDATE ap_user set image=#{filename} where id=#{id}")
    boolean editUserPortraitById(Long id,String filename);

}
